var fs=require("fs");
var path=require("path");
var http=require("http");
http.createServer((req,res)=>{
    res.writeHead(200,{"Content-Type":"text/html"});
    var filePath=path.join(__dirname,"./cat.jpg");
    var imgBuf=fs.readFileSync(filePath);
    var imgBase64=imgBuf.toString("base64");
    res.write("<!DOCTYPE html><html>"+
        "<head></head><body>"+
        "<img src='data:image/jpg; base64,"+imgBase64+"'/></body></html>"
    )
    res.end();
}).listen(8081);
console.log("sever is listening 8081");